package com.kjlink.internal.workreport.stats.lookup;

import com.kjlink.internal.workreport.base.enums.ProjectTimeStatsCategory;
import com.kjlink.internal.workreport.helper.ReportCommonHelper;

/**
 * 描述:
 * 项目的月统计
 *
 * @author Vic.xu
 * @see ProjectTimeStatsCategory#month
 * @since 2024-06-27 11:29
 */
public class ProjectMonthLookup {

    private Integer projectId;

    /**
     * 时间:形如2024或202405
     */
    private Integer startDate;

    private String localStartDate;
    ;

    /**
     * 时间:形如2024或202405
     */
    private Integer endDate;

    private String localEndDate;
    ;

    private ProjectTimeStatsCategory category;


    public ProjectMonthLookup() {
        this.category = ProjectTimeStatsCategory.month;
    }

    public Integer getProjectId() {
        return projectId;
    }

    public void setProjectId(Integer projectId) {
        this.projectId = projectId;
    }

    public Integer getStartDate() {
        if (startDate == null && localStartDate != null) {
            return ReportCommonHelper.toMonthDate(localStartDate);
        }
        return startDate;
    }

    public void setStartDate(Integer startDate) {
        this.startDate = startDate;
    }

    public Integer getEndDate() {
        if (endDate == null && localEndDate != null) {
            return ReportCommonHelper.toMonthDate(localEndDate);
        }
        return endDate;
    }

    public void setEndDate(Integer endDate) {
        this.endDate = endDate;
    }

    public ProjectTimeStatsCategory getCategory() {
        return category;
    }

    public void setCategory(ProjectTimeStatsCategory category) {
        this.category = category;
    }

    public String getLocalStartDate() {
        return localStartDate;
    }

    public void setLocalStartDate(String localStartDate) {
        this.localStartDate = localStartDate;
    }

    public String getLocalEndDate() {
        return localEndDate;
    }

    public void setLocalEndDate(String localEndDate) {
        this.localEndDate = localEndDate;
    }
}
